home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: news.csug.rochester.edu!rit!atd
- From: atd@cs.rit.edu (Albert T Davis)
- Subject: Re: FORTRAN vs C++ BENCHMARKS ???
- Message-ID: <1996Apr7.235903.23056@cs.rit.edu>
- Sender: news@cs.rit.edu (USENET News Admin)
- Nntp-Posting-Host: athens
- Organization: Rochester Institute of Technology, Rochester, NY
- References: <4k7q4q$48h@nntp.Stanford.EDU>
- Date: Sun, 7 Apr 1996 23:59:03 GMT
-
- In article <4k7q4q$48h@nntp.Stanford.EDU> tjb <byer@pangea.stanford.edu> writes:
- >Anyone know if there are any performance comparisons of FORTRAN vs C++ in
- >numerically intensive applications. I'm interested in benchmarks done on
- >RISC machines.
-
- There are lots of them, that generally show that Fortran is faster by
- some trivial amount.
-
- The common benchmark consists of a chunk of code written in a common
- subset of all languages. In other words, the benchmark is carefully
- chosen to give Fortran an advantage.
-
- A more reasonable benchmark would use DIFFERENT programs in both
- languages, both written to take best advantage of the best features of
- the language.
-
- As an example, a common benchmark is LU decomposition if a dense
- matrix of fixed size, using BLAS or a translation of it. The
- benchmark also shows the "problem" C or C++ has in passing arrays into
- functions.
-
- A better benchmark would be a SPARSE matrix, perhaps with a density of
- about 1%. Maybe a bump-and-spike matrix or something like that.
- Compare for speed, ease of programming, code readability. With a test
- like this, C++ will win.
-
- Carrying this on, in real numerically intensive applications, there is
- a need for real data structures (stacks, linked lists, ...) Trying to
- do this part in Fortran will cost much more, and will offset the small
- gain you might get due to a little better optimization.
-
- The biggest problem with C++ (as far as efficiency is concerned) is
- that it is so easy for poor design to hide lots of inefficiency, then
- blame it on the language.
-